PivCoHuffman implementation#61
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f80561440
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| static T read(std::span<const std::byte> data, std::size_t& pos) { | ||
| T value; | ||
| std::memcpy(&value, data.data() + pos, sizeof(T)); | ||
| pos += sizeof(T); |
There was a problem hiding this comment.
Validate compressed input before reading
When callers load a truncated or corrupt persisted stream through the public std::span<const std::byte> constructor, this helper unconditionally copies sizeof(T) bytes from data.data() + pos without checking that the bytes exist; a 1-byte span already reads past the buffer in the first header read, and later node/bitmap reads have the same issue. The deserializer should reject malformed streams before copying or indexing into decoded nodes rather than relying on the input being perfectly formed.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61 +/- ##
==========================================
+ Coverage 90.10% 90.30% +0.20%
==========================================
Files 39 42 +3
Lines 8735 8957 +222
Branches 1418 1447 +29
==========================================
+ Hits 7871 8089 +218
- Misses 447 449 +2
- Partials 417 419 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
No description provided.